using System;

namespace Salient.Web.SQLite.Model
{
    ///<summary>
    ///</summary>
    [Flags]
    public enum FeatureTable
    {
        ///<summary>
        ///</summary>
        Membership = 1,
        ///<summary>
        ///</summary>
        Roles = 2,
        ///<summary>
        ///</summary>
        Profile = 4,
        ///<summary>
        ///</summary>
        PersonalizationPerUser = 8,
        ///<summary>
        ///</summary>
        WebEvent = 16,
        ///<summary>
        ///</summary>
        Unknown1 = 32,
        ///<summary>
        ///</summary>
        Unknown2 = 64,
        ///<summary>
        ///</summary>
        Unknown3 = 128,
        ///<summary>
        ///</summary>
        Unknown4 = 256,
        ///<summary>
        ///</summary>
        Unknown5 = 512,
        ///<summary>
        ///</summary>
        Unknown6 = 1024,
        ///<summary>
        ///</summary>
        All = 2047

    }

    ///<summary>
    ///</summary>
    public static class FeatureTableExtension
    {
        ///<summary>
        ///</summary>
        ///<param name="value"></param>
        ///<param name="bit"></param>
        ///<returns></returns>
        public static bool IsFlagged(this FeatureTable value, FeatureTable bit)
        {
            return (value & bit) == bit;
        }

    }
}